const express = require('express');
const path = require('path')
var app = express();

// view engine setup
app.engine('html', require('express-art-template'));
app.set('view options', {
    debug: process.env.NODE_ENV !== 'production'
});
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'html');

//设置静态目录
app.use(express.static(path.join(__dirname, 'public')))
// routes
app.get('/register', function (req, res) {
    res.render('register.html', {
        user: {
            name: 'aui',
            tags: ['art', 'template', 'nodejs']
        }
    });
});

app.get('/login', function (req, res) {
    res.render('login.html', {
        user: {
            name: 'aui',
            tags: ['art', 'template', 'nodejs']
        }
    });
});

app.listen(10003, () => {
    console.log('服务端运行在10003');
})